﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Class_add.aspx.cs" Inherits="manage_channel_Classa_dd" %>
<%@ Register Src="../../controls/UserPop.ascx" TagName="UserPop" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
<link href="../../sysImages/<%Response.Write(NetCMS.Config.UIConfig.CssPath());%>/css/css.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="../../configuration/js/Prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="../../configuration/js/Public.js"></script>
<script type="text/javascript" src="../../editor/fckeditor.js"></script>
</head>
<body onload="checkpage();">
    <form id="form1" runat="server">
    <table id="top1" width="100%"  border="0" cellpadding="0" cellspacing="0" class="toptable">
        <tr>
          <td height="1" colspan="2"></td>
        </tr>
        <tr>
          <td width="57%" class="sysmain_navi" style="padding-left:14px;">添加/修改频道栏目</td>
          <td width="43%">位置导航：<a href="../main.aspx" class="list_link" target="sys_main">首页</a><img alt="" src="../../sysImages/folder/navidot.gif" border="0" /><a href="list.aspx" class="list_link" target="sys_main">频道列表</a><img alt="" src="../../sysImages/folder/navidot.gif" border="0" /><a href="Class_list.aspx?ChID=<%Response.Write(Request.QueryString["ChID"]); %>" class="list_link" target="sys_main">栏目列表</a><img alt="" src="../../sysImages/folder/navidot.gif" border="0" />添加/修改频道栏目</td>
        </tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
      <tr class="TR_BG_list">
        <td style="text-align:right;width:20%">所属于频道</td>
        <td >
         <span id="ChannelName" class="reshow" runat="server" width="280px"></span>
       </td>
      </tr>
      <tr class="TR_BG_list">
        <td style="text-align:right;">父栏目</td>
        <td >
            <asp:HiddenField ID="ParanetID" runat="server" />
            <asp:HiddenField ID="gClassID" runat="server" />
            <asp:HiddenField ID="gAction" runat="server" />
            <span id="gParentID" class="reshow" runat="server" width="280px"></span>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_ParentID',this)">帮助</span>
        </td>
      </tr>
      
      <tr class="TR_BG_list">
        <td style="text-align:right;">是否是单页面</td>
        <td >
            <asp:CheckBox ID="isPage" runat="server" onclick="checkpage();" />
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_isPage',this)">帮助</span>
        </td>
      </tr>
      
      <tr class="TR_BG_list">
        <td style="text-align:right;">栏目名称</td>
        <td >
            <asp:TextBox ID="classCName" runat="server"  onChange="javascript:GetPY1(this);" Width="300" MaxLength="50"></asp:TextBox>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_classCName',this)">帮助</span>
            <asp:RequiredFieldValidator ID="f_classCName" runat="server" ControlToValidate="classCName" Display="Dynamic" ErrorMessage="<span class='reshow'>请填写栏目名称</span>"></asp:RequiredFieldValidator>
        </td>
      </tr>
      <tr class="TR_BG_list">
        <td style="text-align:right;">栏目英文名称</td>
        <td >
            <asp:TextBox ID="classEName" runat="server" Width="300" MaxLength="50"></asp:TextBox>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_classEName',this)">帮助</span>
            <asp:RequiredFieldValidator ID="f_classEName" runat="server" ControlToValidate="classEName" Display="Dynamic" ErrorMessage="<span class='reshow'>请填写栏目英文名称</span>"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="classEName"  Display="Dynamic" ErrorMessage="<span class='reshow'>只能为数字或者字母.第一个必须为字母,长度：1-18位</span>" ValidationExpression="^[a-zA-Z][a-zA-Z0-9_]{0,18}"></asp:RegularExpressionValidator>
        </td>
      </tr>
      <tr class="TR_BG_list">
        <td style="text-align:right;">栏目权重</td>
        <td >
            <asp:TextBox ID="OrderID" runat="server" Width="300" MaxLength="2">0</asp:TextBox>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_OrderID',this)">帮助</span>
        </td>
      </tr>
     <tr class="TR_BG_list">
        <td style="text-align:right;">栏目模板</td>
        <td >
            <asp:TextBox ID="Templet" runat="server" Width="300" MaxLength="20"></asp:TextBox><img src="../../sysImages/folder/s.gif" alt="选择栏目模板" border="0" style="cursor:pointer;" onclick="selectFile('templet',document.form1.Templet,280,500);document.form1.Templet.focus();" />
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_Templet',this)">帮助</span>
             <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="Templet" Display="Dynamic" ErrorMessage="<span class='reshow'>请填写栏目模板</span>"></asp:RequiredFieldValidator>
        </td>
      </tr>
      <tr class="TR_BG_list">
        <td style="text-align:right;">栏目保存路径</td>
        <td >
            <asp:TextBox ID="SavePath" runat="server" Width="300" MaxLength="50"></asp:TextBox><img src="../../sysImages/folder/s.gif" alt="选择路径" border="0" style="cursor:pointer;" onclick="selectFile('path|<% Response.Write(ClasssavePath); %>',document.form1.SavePath,280,500);document.form1.SavePath.focus();" />
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_SavePath',this)">帮助</span>
        </td>
      </tr>
      <tr class="TR_BG_list">
        <td style="text-align:right;">栏目生成文件名(含扩展名)</td>
        <td >
        <asp:TextBox ID="FileName" runat="server" Width="300" MaxLength="30"></asp:TextBox><img src="../../sysImages/folder/s.gif" alt="选择规则" border="0" style="cursor:pointer;" onclick="selectFile('rulePram',document.form1.FileName,100,500);document.form1.FileName.focus();" />
        <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_FileName',this)">帮助</span>
        <asp:RequiredFieldValidator ID="f_FileName" runat="server" ControlToValidate="FileName" Display="Dynamic" ErrorMessage="<span class='reshow'>请填写栏目的文件名规则及扩展名</span>"></asp:RequiredFieldValidator>
        </td>
      </tr>
      
      
      
      <tr class="TR_BG_list" id="TrcontentTemplet">
        <td style="text-align:right;">栏目下内容模板</td>
        <td >
            <asp:TextBox ID="ContentTemplet" runat="server" Width="300" MaxLength="200"></asp:TextBox><img src="../../sysImages/folder/s.gif" alt="选择栏目模板" border="0" style="cursor:pointer;" onclick="selectFile('templet',document.form1.ContentTemplet,280,500);document.form1.ContentTemplet.focus();" />
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_ContentTemplet',this)">帮助</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ContentTemplet" Display="Dynamic" ErrorMessage="<span class='reshow'>请填写内容模板</span>"></asp:RequiredFieldValidator>
        </td>
      </tr>
      <tr class="TR_BG_list"  id="TrContentSavePath">
        <td style="text-align:right;">栏目下内容保存路径规则</td>
        <td >
            <asp:TextBox ID="ContentSavePath" runat="server" Width="300" MaxLength="200"></asp:TextBox><img src="../../sysImages/folder/s.gif" alt="选择规则" border="0" style="cursor:pointer;" onclick="selectFile('rulesmallPram',document.form1.ContentSavePath,100,500);document.form1.ContentSavePath.focus();" />
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_ContentSavePath',this)">帮助</span>
        </td>
      </tr>
       <tr class="TR_BG_list" id="TrContentFileNameRule">
        <td style="text-align:right;">栏目下内容文件名规则</td>
        <td >
            <asp:TextBox ID="ContentFileNameRule" runat="server" Width="300" MaxLength="100"></asp:TextBox><img src="../../sysImages/folder/s.gif" alt="选择规则" border="0" style="cursor:pointer;" onclick="selectFile('rulePram',document.form1.ContentFileNameRule,100,500);document.form1.ContentFileNameRule.focus();" />
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_ContentFileNameRule',this)">帮助</span>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="ContentFileNameRule" Display="Dynamic" ErrorMessage="<span class='reshow'>请填写内容文件名及扩展名规则</span>"></asp:RequiredFieldValidator>
            
        </td>
      </tr>
       <tr class="TR_BG_list" id="TrPageContent" style="display:none;">
        <td style="text-align:left;" colspan="2">
         <div>单页面内容</div>
       <script type="text/javascript" language="JavaScript">
          window.onload = function()
            {
            var sBasePath = "../../editor/"
            var oFCKeditor = new FCKeditor('PageContent') ;
            oFCKeditor.BasePath	= sBasePath ;
            oFCKeditor.ToolbarSet = 'NT_style';
            oFCKeditor.Width = '100%' ;
            oFCKeditor.Height = '350' ;	
            oFCKeditor.ReplaceTextarea() ;
            }
        </script>
	    <textarea rows="1" cols="1" name="PageContent" style="display:none" id="PageContent" runat="server" ></textarea>
        </td>
      </tr>      
      <tr class="TR_BG_list" id="TrClassSave">
        <td style="text-align:right;">在导航中显示</td>
        <td >
            <asp:CheckBox ID="isShowNavi" runat="server" Checked="true" />
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_isShowNavi',this)">帮助</span>
        </td>
      </tr>      
      
      <tr class="TR_BG_list" id="TrClassFileName">
        <td style="text-align:right;">栏目导读</td>
        <td >
            <asp:TextBox ID="NaviContent" TextMode="MultiLine" runat="server" Height="60px" Width="400" MaxLength="200"></asp:TextBox>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_NaviContent',this)">帮助</span>
        </td>
      </tr>      
      
      <tr class="TR_BG_list" id="TrSavePath">
        <td style="text-align:right;">Meta关键字</td>
        <td >
            <asp:TextBox ID="KeyMeta" runat="server" TextMode="MultiLine"  Height="60px" Width="400"  MaxLength="100"></asp:TextBox>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_KeyMeta',this)">帮助</span>
        </td>
      </tr>      
      
      <tr class="TR_BG_list" id="TrFileName">
        <td style="text-align:right;">Meta描述</td>
        <td >
            <asp:TextBox ID="DescMeta" runat="server" TextMode="MultiLine"  Height="60px" Width="400" MaxLength="150"></asp:TextBox>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_DescMeta',this)">帮助</span>
        </td>
      </tr>      
       
      
      <tr class="TR_BG_list">
        <td style="text-align:right;">图片地址</td>
        <td >
            <asp:TextBox ID="PicURL" runat="server" Width="300" MaxLength="4"></asp:TextBox><img src="../../sysImages/folder/s.gif" alt="选取图片地址" border="0" style="cursor:pointer;" onclick="selectFile('pic',document.form1.PicURL,280,500);document.form1.PicURL.focus();" />
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_PicURL',this)">帮助</span>
        </td>
      </tr>
      
      <tr class="TR_BG_list" id="TrUserPop1">
        <td style="text-align:right;">浏览权限</td>
        <td >
            <uc2:UserPop ID="UserPop1" runat="server"/>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_pop',this)">帮助</span>
        </td>
      </tr>
      
      <tr class="TR_BG_list">
        <td style="text-align:right;">是否锁定</td>
        <td >
            <asp:CheckBox ID="isLock" runat="server" />
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_model_ischeck',this)">帮助</span>
        </td>
      </tr>
    
      <tr class="TR_BG_list" id="Tr1" style="display:none;">
        <td style="text-align:right;">栏目导航</td>
        <td >
            <asp:TextBox ID="ClassNavi" runat="server" TextMode="MultiLine"  Height="80px" Width="400" MaxLength="150"></asp:TextBox>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_ClassNavi',this)">帮助</span>
        </td>
      </tr>      

      <tr class="TR_BG_list" id="Tr2" style="display:none;">
        <td style="text-align:right;">内容导航</td>
        <td >
            <asp:TextBox ID="ContentNavi" runat="server" TextMode="MultiLine"  Height="80px" Width="400" MaxLength="150"></asp:TextBox>
            <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_classAdd_ContentNavi',this)">帮助</span>
        </td>
      </tr>      

      <tr class="TR_BG_list">
        <td style="text-align:right;"></td>
        <td >
         <asp:Button ID="Button1" runat="server" Text="保存栏目" OnClick="Button1_Click" />
         <input type="reset" value="重新填写" />
        </td>
      </tr>
      </table>
    <br />
    <br />
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="copyright_bg" style="height: 76px">
       <tr>
         <td align="center"><label id="copyright" runat="server" /></td>
       </tr>
    </table>
    </form>
</body>
</html>
<script language="javascript" type="text/javascript">
function GetPY1(obj)
{
    if(document.getElementById("gClassID")!='')
    {
        var s = obj.value.trim();
        if(s != '')
        {
            document.getElementById('classEName').value = GetPY(s);
        }
    }
}

function checkpage()
{
    var isPage = document.getElementById("isPage");
    if(isPage.checked)
    {
        document.getElementById("TrcontentTemplet").style.display="none";
        document.getElementById("TrContentSavePath").style.display="none";
        document.getElementById("TrContentFileNameRule").style.display="none";
        document.getElementById("TrPageContent").style.display="";
        document.getElementById("TrUserPop1").style.display="none";
    }
    else
    {
        document.getElementById("TrcontentTemplet").style.display="";
        document.getElementById("TrContentSavePath").style.display="";
        document.getElementById("TrContentFileNameRule").style.display="";
        document.getElementById("TrPageContent").style.display="none";
        document.getElementById("TrUserPop1").style.display="";
    }
}

new Form.Element.Observer($('classEName'),1,classEName_1);
	function classEName_1()
		{
			if ($('classEName').value=='')
			{
				$('ClassNavi').value=''
				$('ContentNavi').value=''
				$('FileName').value=''
			}
			else
			{
//				if( $('gAction').value==null&&$('gAction').value=='')
//				{
				    $('ClassNavi').value='<a href=\"<%Response.Write(dirm); %>/\">首页</a> >> <%Response.Write(ChannelNamenavi); %> >> {@ParentClassStr}'+document.getElementById("classCName").value+' >> 列表 ';
				    $('ContentNavi').value='<a href=\"<%Response.Write(dirm); %>/\">首页</a> >> <%Response.Write(ChannelNamenavi); %> >> {@ParentClassStr}<a href=\"{@ClassURL}\">'+document.getElementById("classCName").value+'</a> >> 正文';
//				}
				    $('FileName').value=document.getElementById("classEName").value+'/index.html';
			}
		} 

</script>